<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=1000, initial-scale=1.0, maximum-scale=1.0">
	    <!-- Loading Bootstrap -->
	    <link href="public/admin/Flat/dist/css/vendor/bootstrap.min.css" rel="stylesheet">
	    <!-- Loading Flat UI -->
	    <link href="public/admin/Flat/dist/css/flat-ui.css" rel="stylesheet">
	    <link href="public/admin/Flat/docs/assets/css/demo.css" rel="stylesheet">
	    <link rel="shortcut icon" href="public/admin/Flat/img/favicon.ico">
	    <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
	    <!--[if lt IE 9]>
	      <script src="dist/js/vendor/html5shiv.js"></script>
	      <script src="dist/js/vendor/respond.min.js"></script>
	    <![endif]-->
	</head>
	<body>
		<div class="alert alert-success">编辑顶级分类</div>
		<form action="" method="post">
		<div class="form-group">
			<label for="exampleInputEmail1">编辑顶级分类名称</label>
			<input id="exampleInputEmail1" class="form-control" type="text" placeholder="请输入分类名称" required="" name="cname" value="<?php echo $data['cname']?>">
		</div>
		<?php if($data['pid']!=0){?>
                
		
		<div class="form-group">
			<label for="exampleInputEmail1">所属分类</label>
			<select name="pid" class="form-control">
				<?php foreach ((array)$fdata as $k=>$v){?>
				<?php if($v['cid']!=$data['cid']){?>
                	
				<option value="<?php echo $v['cid']?>" <?php if($data['pid']==$v['cid']){?>
                selected="selected"
               <?php }?> ><?php echo $v['_cname']?></option>
				
               <?php }?>
				
				<?php }?>
			</select>
		</div>
		<div class="form-group">
			<label for="exampleInputEmail1">所属类型</label>
			<select name="tid" class="form-control">
				<!--判断-->
				<?php foreach ((array)$tdata as $k=>$v){?>
					
				<option value="<?php echo $v['tid']?>" <?php if($data['tid']==$v['tid']){?>
                selected="selected"
               <?php }?>s ><?php echo $v['tname']?></option>
				<?php }?>
			</select>
		</div>
		
               <?php }?>
		
		<div class="form-group">
			<label for="exampleInputEmail1">分类排序</label>
			<input id="exampleInputEmail1" class="form-control" type="text" placeholder="请输入分类排序" required="" name="sort" value="50">
		</div>
		<input type="hidden" name="cid" id="cid" value="<?php echo $data['cid']?>" />
		<button class="btn btn-primary btn-block" type="submit"> 保存 </button>
		</form>
		
	</body>
</html>
